package com.probiz.estore.common.model.customer.base;

import java.io.Serializable;
import com.probiz.estore.Constants;
import com.probiz.estore.core.model.BaseObject;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;

/**
 * ConsultVote Base Java Bean, base class for the model, mapped directly to database table
 * 
 * Avoid changing this file if not necessary, will be overwritten. 
 *
 */
public class ConsultVoteTbl extends BaseObject implements Serializable {

    protected Integer consultVoteId;
	protected java.util.Date createTime;
	protected com.probiz.estore.common.model.system.AppUser appUser;
	protected com.probiz.estore.common.model.customer.Consult consult;
	protected Short chosen;

	/**
	 * Default Empty Constructor for class ConsultVote
	 */
	public ConsultVoteTbl () {
		super();
	}
	
	/**
	 * Default Key Fields Constructor for class ConsultVote
	 */
	public ConsultVoteTbl (
		 Integer in_consultVoteId
        ) {
		this.setConsultVoteId(in_consultVoteId);
    }

	
	public com.probiz.estore.common.model.system.AppUser getAppUser () {
		return appUser;
	}	
	
	public void setAppUser (com.probiz.estore.common.model.system.AppUser in_appUser) {
		this.appUser = in_appUser;
	}
	
	public com.probiz.estore.common.model.customer.Consult getConsult () {
		return consult;
	}	
	
	public void setConsult (com.probiz.estore.common.model.customer.Consult in_consult) {
		this.consult = in_consult;
	}
    

	/**
	 * 	 * @return Integer
     * @hibernate.id column="consultVoteId" type="java.lang.Integer" generator-class="native"
	 */
	public Integer getConsultVoteId() {
		return this.consultVoteId;
	}
	
	/**
	 * Set the consultVoteId
	 */	
	public void setConsultVoteId(Integer aValue) {
		this.consultVoteId = aValue;
	}	

	/**
	 * 	 * @return Integer
	 */
	public Integer getConsultId() {
		return this.getConsult()==null?null:this.getConsult().getConsultId();
	}
	
	/**
	 * Set the consultId
	 */	
	public void setConsultId(Integer aValue) {
	    if (aValue==null) {
	    	consult = null;
	    } else {
	        consult = new com.probiz.estore.common.model.customer.Consult(aValue);
	        consult.setVersion(Integer.valueOf(0));//set a version to cheat hibernate only
	    }
	}	

	/**
	 * 	 * @return Integer
	 */
	public Integer getCustomerId() {
		return this.getAppUser()==null?null:this.getAppUser().getAppuserId();
	}
	
	/**
	 * Set the customerId
	 */	
	public void setCustomerId(Integer aValue) {
	    if (aValue==null) {
	    	appUser = null;
	    } else {
	        appUser = new com.probiz.estore.common.model.system.AppUser(aValue);
	        appUser.setVersion(Integer.valueOf(0));//set a version to cheat hibernate only
	    }
	}	

	/**
	 * 投票时间	 * @return java.util.Date
	 * @hibernate.property column="createTime" type="java.util.Date" length="19" not-null="false" unique="false"
	 */
	public java.util.Date getCreateTime() {
		return this.createTime;
	}
	
	/**
	 * Set the createTime
	 */	
	public void setCreateTime(java.util.Date aValue) {
		this.createTime = aValue;
	}	
	

	public Short getChosen() {
		return chosen;
	}

	public void setChosen(Short chosen) {
		this.chosen = chosen;
	}

	/**
	 * @see java.lang.Object#equals(Object)
	 */
	public boolean equals(Object object) {
		if (!(object instanceof ConsultVoteTbl)) {
			return false;
		}
		ConsultVoteTbl rhs = (ConsultVoteTbl) object;
		return new EqualsBuilder()
				.append(this.consultVoteId, rhs.consultVoteId)
								.append(this.createTime, rhs.createTime)
				.isEquals();
	}

	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return new HashCodeBuilder(-82280557, -700257973)
				.append(this.consultVoteId) 
								.append(this.createTime) 
				.toHashCode();
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this)
				.append("consultVoteId", this.consultVoteId) 
								.append("createTime", this.createTime) 
				.toString();
	}

	/**
	 * Return the name of the first key column
	 */
	public String getFirstKeyColumnName() {
		return "consultVoteId";
	}
	
	/**
	 * Return the Id (pk) of the entity, must be Integer
	 */
	public Integer getId() {
		return consultVoteId;
	}

}